/**
 * @param {number} x
 * @return {boolean}
 */
 var isPalindrome = function(x) {
     if(x<0){
         return false;
     }
    let str=x.toString();
    let length=str.length;
    for(let i=0;i<length/2;i++){
        if(str[i]!=str[length-i-1]){
            return false;
        }
    }
    return true;
};
console.log(isPalindrome(10));